﻿<Window x:Class="New3DDemo.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="350" Width="525"
         xmlns:t="clr-namespace:HelixToolkit;assembly=HelixToolkit"
          xmlns:local="clr-namespace:New3DDemo">
    <Window.Resources>
        <!--<ImageBrush x:Key="RoadBackImg" ImageSource="pack://siteOfOrigin:,,,/images/else/road.jpg"/>-->
        <MeshGeometry3D  x:Key="geometry"
               Positions="-1,1.2,0, -1,-1.2,0, 3,-1.2,0, 3,1.2,0"
               TextureCoordinates="0,0 0,1 1,1 1,0" 
               TriangleIndices="0 1 2 0 2 3"/>
        <DiffuseMaterial x:Key="material" Viewport2DVisual3D.IsVisualHostMaterial="True" Brush="Red" />
    </Window.Resources>
    <!--<Window.Background>
        <DrawingBrush Viewbox="0,0,450,320" Viewport="0,0,450,320" ViewboxUnits="Absolute" ViewportUnits="Absolute" TileMode="Tile">
            <DrawingBrush.Drawing>
                <ImageDrawing ImageSource="1.jpg" Rect="0,0,450,320">

                </ImageDrawing>
            </DrawingBrush.Drawing>
        </DrawingBrush>
    </Window.Background>-->
    <Grid >

        <t:HelixViewport3D  ShowCoordinateSystem="True" ZoomSensitivity="1" x:Name="port"  MouseDown="port_MouseDown">
            <t:DefaultLights/>
            <t:GridLinesVisual3D  Center="-0.5,-0.5,-0.01" Width="100" Length="100" MinorDistance="1" MajorDistance="10" Thickness="0.04" Fill="Black">              
            </t:GridLinesVisual3D>
            <!--<local:LegoVisual3D Rows="40" Columns="40" Height="1" Fill="Green" Divisions="8"/>-->
            <Viewport2DVisual3D  x:Name="viewport2DVisual3D0" Geometry="{StaticResource geometry}"  Material="{StaticResource material}" >
                <Viewport2DVisual3D.Visual>
                    <Grid Background="{x:Null}">
                        <Border >
                            <Grid >
                                <Grid Margin="120">
                                    <!--<local:Roads  Loaded="RoadCollection_Loaded">                            
                                    </local:Roads>-->
                                    <local:Road  OriginPoints="4,31 94.5,96.5 188.5,149.5 314.5,187.5 402.5,257.5 466.5,321.5 487.5,389.5">
                                    </local:Road>
                                    <Canvas>
                                        <local:IsolationBelt x:Name="il"  OriginPoints="4,31 94.5,96.5 188.5,149.5 314.5,187.5 402.5,257.5 466.5,321.5 487.5,389.5"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="1" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="2" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="3" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="4" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="-1" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="-2" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="-3" Offset="{Binding BeltWidth,ElementName=il}"/>
                                        <local:Lane OriginPoints="{Binding OriginPoints,ElementName=il}" LaneIndex="-4" Offset="{Binding BeltWidth,ElementName=il}"/>
                                    </Canvas>

                             
                                    <Canvas x:Name="lanes"/>
                                    <Canvas x:Name="direction"/>
                                </Grid>
                            </Grid>
                        </Border>
                    </Grid>
                </Viewport2DVisual3D.Visual>
            </Viewport2DVisual3D>
            <t:DefaultLights/>
        </t:HelixViewport3D>

        <!--<local:Lane MiddleLinePoints="4,31 94.5,96.5 188.5,149.5 314.5,187.5 402.5,257.5 466.5,321.5 487.5,389.5"/>-->
        <!--<local:IsolationBelt MiddleLinePoints="4,31 94.5,96.5 188.5,149.5 314.5,187.5 402.5,257.5 466.5,321.5 487.5,389.5"/>-->
    </Grid>
</Window>
